//
//  SecondTableViewCell.m
//  Beauty
//
//  Created by Snow on 16/9/3.
//  Copyright © 2016年 Snow. All rights reserved.
//

#import "SecondTableViewCell.h"
#import "GXMacro.h"
@implementation SecondTableViewCell
- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        _imageOfPerson = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageOfPerson];
        _imageOfContent = [[UIImageView alloc] init];
        [self.contentView addSubview:_imageOfContent];
        _labelOfName = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfName];
        _buttonOfLookItAllTheTime = [UIButton buttonWithType:UIButtonTypeSystem];
        [self.contentView addSubview:_buttonOfLookItAllTheTime];
        _buttonOfLookItAllTheTime.layer.masksToBounds = YES;
        _buttonOfLookItAllTheTime.layer.cornerRadius = 5;
        _buttonOfLookItAllTheTime.layer.borderWidth = 1;
        _buttonOfLookItAllTheTime.layer.borderColor = [[UIColor colorWithRed:0.949 green:0.518 blue:0.651 alpha:1.000] CGColor];
        [_buttonOfLookItAllTheTime setTitle:@"+关注" forState:UIControlStateNormal];
        _buttonOfLookItAllTheTime.titleLabel.font = [UIFont systemFontOfSize:15];
        _buttonOfLookItAllTheTime.tintColor = [UIColor colorWithRed:0.949 green:0.518 blue:0.651 alpha:1.000];
        _labelOfLikeCount = [[UILabel alloc] init];
        [self.contentView addSubview:_labelOfLikeCount];
        
    }
    return self;
}
- (void)layoutSubviews
{
    [super layoutSubviews];
    [_imageOfContent mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.contentView.mas_top);
        make.left.mas_equalTo(self.contentView.mas_left);
        make.right.mas_equalTo(self.contentView.mas_right);
        make.bottom.mas_equalTo(self.contentView.mas_bottom);
    }];
#if 0
    [_imageOfPerson mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.contentView.mas_left).mas_equalTo(10);
        make.top.mas_equalTo(_imageOfContent.mas_bottom).mas_equalTo(10);
        make.height.mas_equalTo(20);
        make.width.mas_equalTo(20);
    }];
#warning label自适应长度
    
   CGFloat width = self.widthBlock(20);
        [_labelOfName mas_makeConstraints:^(MASConstraintMaker *make) {
            make.left.mas_equalTo(_imageOfPerson.mas_right).mas_equalTo(10);
            make.top.mas_equalTo(_imageOfContent.mas_bottom);
            make.width.mas_equalTo(width);
            make.height.mas_equalTo(20);
        }];
    [_buttonOfLookItAllTheTime mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(_imageOfPerson.mas_right).mas_equalTo(10);
        make.width.mas_equalTo(60);
        make.top.mas_equalTo(_labelOfName.mas_bottom);
        make.height.mas_equalTo(20);
    }];
#endif
}

@end
